package com.vctgo.system.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.vctgo.system.mapper.TAccountMapper;
import com.vctgo.system.domain.TAccount;
import com.vctgo.system.service.ITAccountService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.vctgo.common.core.text.Convert;
import com.vctgo.common.core.utils.ServletUtils;
import com.vctgo.common.mybatisplus.constant.MybatisPageConstants;
/**
 * 账套详细Service业务层处理
 *
 * @author vctgo
 * @date 2024-12-17
 */
@Service
public class TAccountServiceImpl implements ITAccountService
{
    @Autowired
    private TAccountMapper tAccountMapper;

    /**
     * 查询账套详细
     *
     * @param id 账套详细主键
     * @return 账套详细
     */
    @Override
    public TAccount selectTAccountById(Integer id)
    {
        return tAccountMapper.selectById(id);
    }

    /**
     * 查询账套详细列表-分页
     *
     * @param tAccount 账套详细
     * @return 账套详细
     */
    @Override
    public IPage<TAccount> selectTAccountPage(TAccount tAccount)
    {
        Page mpPage =new Page(Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_NUM),1L)
                ,Convert.toLong(ServletUtils.getParameterToInt(MybatisPageConstants.PAGE_SIZE),10L));
        return tAccountMapper.selectTAccountList(mpPage,tAccount);
    }
    /**
     * 查询账套详细列表
     *
     * @param tAccount 账套详细
     * @return 账套详细
     */
    @Override
    public List<TAccount> selectTAccountList(TAccount tAccount)
    {
        return tAccountMapper.selectTAccountList(tAccount);
    }

    /**
     * 新增账套详细
     *
     * @param tAccount 账套详细
     * @return 结果
     */

    @Override
    public int insertTAccount(TAccount tAccount)
    {
        return tAccountMapper.insert(tAccount);
    }

    /**
     * 修改账套详细
     *
     * @param tAccount 账套详细
     * @return 结果
     */
    @Override
    public int updateTAccount(TAccount tAccount)
    {
        return tAccountMapper.updateById(tAccount);
    }

    /**
     * 批量删除账套详细
     *
     * @param ids 需要删除的账套详细主键
     * @return 结果
     */
    @Override
    public int deleteTAccountByIds(Integer[] ids)
    {
        return tAccountMapper.deleteTAccountByIds(ids);
    }

    /**
     * 删除账套详细信息
     *
     * @param id 账套详细主键
     * @return 结果
     */
    @Override
    public int deleteTAccountById(Integer id)
    {
        return tAccountMapper.deleteById(id);
    }
}
